import time
from ElementsApi.ElementsApi_Page import ElementsBase
from appium.webdriver.common.mobileby import MobileBy
import allure
@allure.feature("豆苗app登录")
class LoginPage(ElementsBase):
    def __init__(self,driver):
        ElementsBase.__init__(self,driver)
    @allure.step("点击同意隐私政策")
    def click_allow(self):
        self.click_element((MobileBy.ID,"com.threegene.doctor:id/agree_user_agreement_btn"))
    @allure.step("滑动引导页")
    def press_introducer(self):
        self.press_move_to(684,1044,36,863)
        self.press_move_to(684,1044,36,863)
    @allure.step("点击立即体验")
    def click_experience(self):
        self.click_element((MobileBy.ID, "com.threegene.doctor:id/submit_btn"))
    @allure.step("点击阅读")
    def click_read(self):
        self.click_element((MobileBy.CLASS_NAME, "android.widget.CompoundButton"))
    @allure.step("点击手机号登录")
    def click_phone_login(self):
        self.click_element((MobileBy.ID, "com.threegene.doctor:id/tv_phone_login"))
    @allure.step("输入内容")
    def input_content(self):
        self.input_text((MobileBy.ID, "com.threegene.doctor:id/edit_phone_number"),"15948551301")
    @allure.step("发送验证码")
    def Send_verification_code(self):
        self.click_element((MobileBy.ID, "com.threegene.doctor:id/tv_send_code"))
    @allure.step("断言文本内容")
    def assert_content(self):
        text = self.find_element((MobileBy.ID, "com.threegene.doctor:id/sms_send_hint")).text
        assert text in "已发送验证码至159****1301"























